package de.jmda.gen.java.naming;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

public class JUTImportManagerProvider
{
	@Test
	public void test()
	{
		String x = "x";
		String y = "y";

		ImportManagerProvider.newImportManager(x, "X");
		
		ImportManager importManager = ImportManagerProvider.getImportManager();

		assertEquals(x, importManager.getPackagename());

		ImportManager importManagerBackup =
				ImportManagerProvider.newImportManager(y, "Y");

		assertEquals(x, importManagerBackup.getPackagename());

		importManager = ImportManagerProvider.getImportManager();
		
		assertEquals(y, importManager.getPackagename());

		ImportManagerProvider.restoreImportManager(importManagerBackup);

		importManager = ImportManagerProvider.getImportManager();
		
		assertEquals(x, importManager.getPackagename());
	}
}